<?php
require 'db.php';
require 'function.php';
$admin1 = new Manager($link);
$id = $_GET['id'];

if ($id != 1){
if (isset($_POST['submit'])){
    
    $admin = $_POST['admin'];
    $status = $_POST['status'];
    $password = $_POST['password'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    
    $query = $admin1->editAdmin($admin, $status,$password,$email,$phone, $id);
    if ($query){
        header("Location:m_admin.php");
    }
    }
}else{
        echo "<script>alert('超级管理员禁止修改！');</script>";
        echo "<script>history.go(-1);</script>";
        exit();
    }




$data = $admin1->getAdminById($id);
require 'edit.html';
?>